﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CafeApp.ViewModel;

namespace CafeApp.Service
{
    public class HANG_HOA_SERVICE
    {
        RESMANEntities db = new RESMANEntities();

        public List<HANGHOA> GetList()
        {
            try
            {
                var c = db.HANGHOAs.OrderBy(p => p.TENHH).ToList();
                return c;
            }
            catch
            {
                return null;
            }
        }

        public HANGHOA GetById(string id)
        {
            try
            {

                return db.HANGHOAs.Where(p => p.MAHH == id).First();
            }
            catch
            {
                return null;
            }
        }
    }
}